package com.tyk.demo.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.tyk.demo.aspect.Dict;
import com.tyk.demo.utils.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@ApiModel
public class UserInfo extends BaseEntity{
    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "userId",name = "userID")
    private String userId;

    /**
     * 用户名
     */
    private String username;

    /**
     * 创建时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime addtime;

    /**
     * userType
     */
    @Dict(typeId = "1",text = "userType_text")
    private Integer userType;

    /**
     * userType
     */
    @Dict(typeId = "2")
    private Integer userNation;
}
